package com.lc.pianostudent.dialog;

import android.content.Context;
import android.os.Bundle;
import android.view.Gravity;
import android.view.View;


import com.lc.pianostudent.R;
import com.zcx.helper.dialog.AppDialog;

/**
 * Created by Administrator on 2017/8/12.
 */

public abstract class PictureDialog extends AppDialog {

    public PictureDialog(Context context) {

        super(context, R.style.Dialog);

    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {

        super.onCreate(savedInstanceState);

        getWindow().setGravity(Gravity.BOTTOM);

        setContentView(R.layout.dialog_picture);
        getWindow().getAttributes().dimAmount = 0.3f;

        setCanceledOnTouchOutside(true);
        View.OnClickListener listener = new View.OnClickListener() {

            @Override
            public void onClick(View view) {

                switch (view.getId()) {

                    case R.id.dialog_picture_photo:


                        onAlbum();

                        break;

                    case R.id.dialog_picture_camera:

                        onCamera();

                        break;

                }

                dismiss();

            }

        };

        findViewById(R.id.dialog_picture_photo).setOnClickListener(listener);

        findViewById(R.id.dialog_picture_camera).setOnClickListener(listener);

        findViewById(R.id.dialog_picture_cancel).setOnClickListener(listener);

    }

    public abstract void onAlbum();

    public abstract void onCamera();

}
